package com.bwt.top.bwt_ad_flutter;

import android.util.Log;

import androidx.annotation.NonNull;

import com.bwt.top.bwt_ad_flutter.manager.BwtAdManager;

import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;

/**
 * BwtAdFlutterPlugin
 */
public class BwtAdFlutterPlugin implements FlutterPlugin, MethodCallHandler {

    @Override
    public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
        Log.d("log1","1");
        BwtAdManager.getInstance().init(flutterPluginBinding, this);
    }

    @Override
    public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
        Log.d("log1","3--%s"+call.method);
        BwtAdManager.getInstance().onMethodCall(call, result);
    }

    @Override
    public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
        Log.d("log1","3");
        BwtAdManager.getInstance().unInit();
    }

}
